package day04;
import java.util.Scanner;
public class Homework1 {
    public static void main(String[] args) {
        //1
        /*
        Scanner scan = new Scanner(System.in);
        System.out.println("1.取款 2.存款 3.查询余额 4.退卡");
        int command = scan.nextInt();
        switch (command){
            case 1:
                System.out.println("取款业务");
                break;
            case 2:
                System.out.println("存款业务");
                break;
            case 3:
                System.out.println("查询余额业务");
                break;
            case 4:
                System.out.println("退卡");
                break;
            default:
                System.out.println("输入错误");
        }

         */
        //2
        /*
        Scanner scan = new Scanner(System.in);
        System.out.println("猜吧");
        int num = (int) (Math.random()*1000+1);
        int guess = scan.nextInt();
        while (guess!=num){

            if (guess<num){
                System.out.println("小了");
            }else {
                System.out.println("大了");
            }
            guess = scan.nextInt();
        }
        System.out.println("对了");

         */
        //3
        /*
        Scanner scan = new Scanner(System.in);
        int num = (int)(Math.random()*1000-1);
        System.out.println("猜吧");
        int guess;
        do{
            guess = scan.nextInt();
            if (guess<num){
                System.out.println("小了");
            } else if (guess>num) {
                System.out.println("大了");
            }else {
                System.out.println("对了");
            }

        }while (guess!=num);

         */
        //4
        /*
        for (int times=0;times<5;times++){
            System.out.println("行动是成功的阶梯");
        }
        for (int num=1;num<=9;num++){
            System.out.println(num+"*9="+num*9);
        }
        for (int num=1;num<=9;num+=2){
            System.out.println(num+"*9="+num*9);
        }
        for (int num=9;num>=1;num--){
            System.out.println(num+"*9="+num*9);
        }
        int sum = 0;
        for (int num=1;num<=100;num++){
            sum = sum+num;
        }
        System.out.println("和为"+sum);

         */

        //5
        /*
        for (int num=1;num<=9;num++){
            if (num==4){
                break;//中断跳出循环
            }
            System.out.println(num+"*9="+num*9);
        }
        for (int num=1;num<=9;num++){
            if (num%3==0){
                continue;//跳过
            }
            System.out.println(num+"*9="+num*9);
        }

         */
    }
}
